#!/bin/sh
name=@PACKAGE@-@VERSION@
echo creating $name.tar.gz
rm -f ${name}
rm -f ${name}.tar
rm -f ${name}.tar.gz
ln -s ./ ${name}
cd lib/action;make generated >/dev/null 2>&1;cd ../..

SOURCES="${name}/src/swfcombine.1 \
${name}/src/swfstrings.1 \
${name}/src/swfdump.1 \
${name}/src/swfextract.1 \
${name}/src/jpeg2swf.1 \
${name}/src/png2swf.1 \
${name}/src/pdf2swf.1 \
${name}/src/gif2swf.1 \
${name}/src/wav2swf.1 \
${name}/src/swfc.1 \
${name}/src/swfbbox.1 \
${name}/src/font2swf.1 \
${name}/src/swfrender.1 \
${name}/src/as3compile.1 \
${name}/src/swfbytes.1 \
${name}/src/pdf2pdf.1 \
${name}/src/swfcombine.c \
${name}/src/swfstrings.c \
${name}/src/swfdump.c \
${name}/src/font2swf.c \
${name}/src/swfbbox.c \
${name}/src/swfextract.c \
${name}/src/jpeg2swf.c \
${name}/src/ttftool.c \
${name}/src/png2swf.c \
${name}/src/gif2swf.c \
${name}/src/wav2swf.c \
${name}/src/pdf2swf.c \
${name}/src/pdf2pdf.c \
${name}/lib/pdf/pdf2jpeg.c \
${name}/src/swfc.c \
${name}/src/swfc-feedback.c \
${name}/src/swfc-history.c \
${name}/src/swfc-interpolation.c \
${name}/src/swfc-feedback.h \
${name}/src/swfc-history.h \
${name}/src/swfc-interpolation.h \
${name}/src/parser.yy.c \
${name}/src/parser.lex \
${name}/src/parser.h \
${name}/src/swfrender.c \
${name}/src/swfbytes.c \
${name}/src/as3compile.c \
${name}/swfs/simple_viewer.c \
${name}/swfs/keyboard_viewer.c \
${name}/swfs/PreLoaderTemplate.c \
${name}/swfs/PreLoaderTemplate.sc \
${name}/swfs/rfxview.sc \
${name}/swfs/rfxview.swf \
${name}/swfs/swft_loader.swf \
${name}/swfs/tessel_loader.swf"

AVI2SWF="${name}/avi2swf/avi2swf.cc \
${name}/avi2swf/videoreader.h \
${name}/avi2swf/videoreader_avifile.hh \
${name}/avi2swf/videoreader_avifile.cc \
${name}/avi2swf/videoreader_vfw.hh \
${name}/avi2swf/videoreader_vfw.cc \
${name}/avi2swf/v2swf.c \
${name}/avi2swf/v2swf.h \
${name}/avi2swf/avi2swf.1"

MAKEFILES="${name}/src/Makefile.in \
${name}/lib/readers/Makefile.in \
${name}/lib/Makefile.in \
${name}/avi2swf/Makefile.in \
${name}/lib/pdf/Makefile.in \
${name}/lib/action/Makefile.in \
${name}/swfs/Makefile.in \
${name}/Makefile.in \
${name}/Makefile.common.in"

LIB="${name}/lib/types.h \
${name}/lib/action/lex.swf4.c \
${name}/lib/action/lex.swf5.c \
${name}/lib/action/swf4compiler.tab.c \
${name}/lib/action/swf5compiler.tab.c \
${name}/lib/action/swf4compiler.tab.h \
${name}/lib/action/swf5compiler.tab.h \
${name}/lib/args.h \
${name}/lib/bitio.c \
${name}/lib/bitio.h \
${name}/lib/q.c \
${name}/lib/q.h \
${name}/lib/utf8.c \
${name}/lib/utf8.h \
${name}/lib/base64.c \
${name}/lib/base64.h \
${name}/lib/png.h \
${name}/lib/png.c \
${name}/lib/jpeg.h \
${name}/lib/jpeg.c \
${name}/lib/kdtree.h \
${name}/lib/kdtree.c \
${name}/lib/drawer.c \
${name}/lib/drawer.h \
${name}/lib/mem.c \
${name}/lib/mem.h \
${name}/lib/graphcut.c \
${name}/lib/graphcut.h \
${name}/lib/modules/swffilter.c \
${name}/lib/modules/swfrender.c \
${name}/lib/modules/swfalignzones.c \
${name}/lib/readers/swf.c \
${name}/lib/readers/swf.h \
${name}/lib/readers/image.c \
${name}/lib/readers/image.h \
${name}/lib/modules/swfdump.c \
${name}/lib/modules/swfobject.c \
${name}/lib/modules/swfshape.c \
${name}/lib/modules/swftext.c \
${name}/lib/modules/swffont.c \
${name}/lib/gfxfont.h \
${name}/lib/gfxfont.c \
${name}/lib/modules/swfbutton.c \
${name}/lib/modules/swfbits.c \
${name}/lib/modules/swftools.c \
${name}/lib/modules/swfcgi.c \
${name}/lib/modules/swfsound.c \
${name}/lib/mp3.c \
${name}/lib/wav.c \
${name}/lib/wav.h \
${name}/lib/mp3.h \
${name}/lib/xml.h \
${name}/lib/xml.c \
${name}/lib/ttf.h \
${name}/lib/ttf.c \
${name}/lib/modules/swfdraw.c \
${name}/lib/modules/swfaction.c \
${name}/lib/as3/parser_help.h \
${name}/lib/as3/parser_help.c \
${name}/lib/as3/state.h \
${name}/lib/as3/state.c \
${name}/lib/as3/assets.c \
${name}/lib/as3/assets.h \
${name}/lib/as3/code.c \
${name}/lib/as3/code.h \
${name}/lib/as3/import.c \
${name}/lib/as3/import.h \
${name}/lib/as3/registry.c \
${name}/lib/as3/registry.h \
${name}/lib/as3/builtin.c \
${name}/lib/as3/builtin.h \
${name}/lib/as3/opcodes.c \
${name}/lib/as3/opcodes.h \
${name}/lib/as3/pool.c \
${name}/lib/as3/pool.h \
${name}/lib/as3/files.c \
${name}/lib/as3/files.h \
${name}/lib/as3/abc.c \
${name}/lib/as3/abc.h \
${name}/lib/as3/compiler.c \
${name}/lib/as3/compiler.h \
${name}/lib/as3/parser.h \
${name}/lib/as3/common.h \
${name}/lib/as3/common.c \
${name}/lib/as3/tokenizer.yy.c \
${name}/lib/as3/tokenizer.h \
${name}/lib/as3/expr.h \
${name}/lib/as3/expr.c \
${name}/lib/as3/parser.tab.c \
${name}/lib/as3/parser.tab.h \
${name}/lib/as3/initcode.c \
${name}/lib/as3/initcode.h \
${name}/lib/as3/scripts.c \
${name}/lib/as3/scripts.h \
${name}/lib/action/action.h \
${name}/lib/action/actioncompiler.c \
${name}/lib/action/actioncompiler.h \
${name}/lib/action/assembler.c \
${name}/lib/action/assembler.h \
${name}/lib/action/blocks/error.h \
${name}/lib/action/compile.c \
${name}/lib/action/compile.h \
${name}/lib/action/libming.c \
${name}/lib/action/libming.h \
${name}/lib/action/listaction.c \
${name}/lib/action/ming.h \
${name}/lib/action/swf4compiler.flex \
${name}/lib/action/swf4compiler.y \
${name}/lib/action/swf5compiler.flex \
${name}/lib/action/swf5compiler.y \
${name}/lib/h.263/swfvideo.c \
${name}/lib/h.263/h263tables.c \
${name}/lib/h.263/h263tables.h \
${name}/lib/h.263/dct.c \
${name}/lib/h.263/dct.h
${name}/lib/rfxswf.c \
${name}/lib/rfxswf.h \
${name}/lib/old_rfxswf.h \
${name}/lib/log.c \
${name}/lib/log.h \
${name}/lib/os.c \
${name}/lib/os.h \
${name}/lib/gfximage.c \
${name}/lib/gfximage.h \
${name}/lib/gfxdevice.h \
${name}/lib/gfxsource.h \
${name}/lib/gfxtools.h \
${name}/lib/gfxpoly.h \
${name}/lib/gfxtools.c \
${name}/lib/gfxfilter.h \
${name}/lib/gfxfilter.c \
${name}/lib/gfxpoly/active.c \
${name}/lib/gfxpoly/active.h \
${name}/lib/gfxpoly/convert.c \
${name}/lib/gfxpoly/convert.h \
${name}/lib/gfxpoly/poly.c \
${name}/lib/gfxpoly/poly.h \
${name}/lib/gfxpoly/renderpoly.c \
${name}/lib/gfxpoly/renderpoly.h \
${name}/lib/gfxpoly/stroke.c \
${name}/lib/gfxpoly/stroke.h \
${name}/lib/gfxpoly/wind.c \
${name}/lib/gfxpoly/wind.h \
${name}/lib/gfxpoly/xrow.c \
${name}/lib/gfxpoly/xrow.h \
${name}/lib/gfxpoly/moments.c \
${name}/lib/gfxpoly/moments.h \
${name}/lib/gfxpoly/heap.h \
${name}/lib/pdf/bbox.c \
${name}/lib/pdf/bbox.h \
${name}/lib/kdtree.c \
${name}/lib/kdtree.h \
${name}/lib/devices/swf.h \
${name}/lib/devices/swf.c \
${name}/lib/devices/file.h \
${name}/lib/devices/file.c \
${name}/lib/devices/render.c \
${name}/lib/devices/render.h \
${name}/lib/devices/text.c \
${name}/lib/devices/text.h \
${name}/lib/devices/pdf.c \
${name}/lib/devices/pdf.h \
${name}/lib/devices/polyops.c \
${name}/lib/devices/polyops.h \
${name}/lib/devices/record.c \
${name}/lib/devices/record.h \
${name}/lib/devices/opengl.c \
${name}/lib/devices/opengl.h \
${name}/lib/devices/rescale.c \
${name}/lib/devices/rescale.h \
${name}/lib/devices/dummy.c \
${name}/lib/devices/dummy.h \
${name}/lib/devices/bbox.c \
${name}/lib/devices/bbox.h \
${name}/lib/devices/ops.c \
${name}/lib/devices/ops.h \
${name}/lib/filters/alpha.c \
${name}/lib/filters/one_big_font.c \
${name}/lib/filters/vectors_to_glyphs.c \
${name}/lib/filters/remove_font_transforms.c \
${name}/lib/filters/remove_invisible_characters.c \
${name}/lib/filters/flatten.c \
${name}/lib/filters/rescale_images.c \
${name}/lib/pdf/popplercompat.cc \
${name}/lib/pdf/popplercompat.h \
${name}/lib/pdf/VectorGraphicOutputDev.h \
${name}/lib/pdf/VectorGraphicOutputDev.cc \
${name}/lib/pdf/CharOutputDev.h \
${name}/lib/pdf/CharOutputDev.cc \
${name}/lib/pdf/CommonOutputDev.h \
${name}/lib/pdf/CommonOutputDev.cc \
${name}/lib/pdf/BitmapOutputDev.h \
${name}/lib/pdf/FullBitmapOutputDev.h \
${name}/lib/pdf/BitmapOutputDev.cc \
${name}/lib/pdf/FullBitmapOutputDev.cc \
${name}/lib/pdf/InfoOutputDev.h \
${name}/lib/pdf/InfoOutputDev.cc \
${name}/lib/pdf/XMLOutputDev.h \
${name}/lib/pdf/XMLOutputDev.cc \
${name}/lib/pdf/CommonOutputDev.h \
${name}/lib/pdf/fonts.c \
${name}/lib/pdf/fonts.h \
${name}/lib/pdf/pdf.cc \
${name}/lib/pdf/pdf.h \
${name}/lib/pdf/popplercompat.cc \
${name}/lib/pdf/popplercompat.h \
${name}/lib/pdf/xpdf/Annot.cc \
${name}/lib/pdf/xpdf/Annot.h \
${name}/lib/pdf/xpdf/Array.cc \
${name}/lib/pdf/xpdf/Array.h \
${name}/lib/pdf/xpdf/BuiltinFont.cc \
${name}/lib/pdf/xpdf/BuiltinFont.h \
${name}/lib/pdf/xpdf/BuiltinFontTables.cc \
${name}/lib/pdf/xpdf/BuiltinFontTables.h \
${name}/lib/pdf/xpdf/CMap.cc \
${name}/lib/pdf/xpdf/CMap.h \
${name}/lib/pdf/xpdf/SecurityHandler.cc \
${name}/lib/pdf/xpdf/SecurityHandler.h \
${name}/lib/pdf/xpdf/Catalog.cc \
${name}/lib/pdf/xpdf/Catalog.h \
${name}/lib/pdf/xpdf/CharCodeToUnicode.cc \
${name}/lib/pdf/xpdf/CharCodeToUnicode.h  \
${name}/lib/pdf/xpdf/CharTypes.h \
${name}/lib/pdf/xpdf/Decrypt.cc \
${name}/lib/pdf/xpdf/Decrypt.h \
${name}/lib/pdf/xpdf/Dict.cc \
${name}/lib/pdf/xpdf/Dict.h \
${name}/lib/pdf/xpdf/Error.cc \
${name}/lib/pdf/xpdf/Error.h \
${name}/lib/pdf/xpdf/ErrorCodes.h \
${name}/lib/pdf/xpdf/FontEncodingTables.cc \
${name}/lib/pdf/xpdf/FontEncodingTables.h \
${name}/lib/pdf/xpdf/Function.cc \
${name}/lib/pdf/xpdf/Function.h \
${name}/lib/pdf/xpdf/GHash.cc \
${name}/lib/pdf/xpdf/GHash.h \
${name}/lib/pdf/xpdf/GList.cc \
${name}/lib/pdf/xpdf/GList.h \
${name}/lib/pdf/xpdf/GString.cc \
${name}/lib/pdf/xpdf/GString.h \
${name}/lib/pdf/xpdf/Gfx.cc \
${name}/lib/pdf/xpdf/Gfx.h \
${name}/lib/pdf/xpdf/GfxFont.cc \
${name}/lib/pdf/xpdf/GfxFont.h \
${name}/lib/pdf/xpdf/GfxState.cc \
${name}/lib/pdf/xpdf/GfxState.h \
${name}/lib/pdf/cmyk.cc \
${name}/lib/pdf/cmyk.h \
${name}/lib/pdf/xpdf/GlobalParams.cc \
${name}/lib/pdf/xpdf/GlobalParams.h \
${name}/lib/pdf/xpdf/Lexer.cc \
${name}/lib/pdf/xpdf/Lexer.h \
${name}/lib/pdf/xpdf/Link.cc \
${name}/lib/pdf/xpdf/Link.h \
${name}/lib/pdf/xpdf/NameToCharCode.cc \
${name}/lib/pdf/xpdf/NameToCharCode.h \
${name}/lib/pdf/xpdf/NameToUnicodeTable.h \
${name}/lib/pdf/xpdf/UnicodeTypeTable.cc \
${name}/lib/pdf/xpdf/UnicodeTypeTable.h \
${name}/lib/pdf/xpdf/Object.cc \
${name}/lib/pdf/xpdf/Object.h \
${name}/lib/pdf/xpdf/OutputDev.cc \
${name}/lib/pdf/xpdf/OutputDev.h \
${name}/lib/pdf/xpdf/PDFDoc.cc \
${name}/lib/pdf/xpdf/PDFDoc.h \
${name}/lib/pdf/xpdf/PSTokenizer.cc \
${name}/lib/pdf/xpdf/PSTokenizer.h \
${name}/lib/pdf/xpdf/Page.cc \
${name}/lib/pdf/xpdf/Page.h \
${name}/lib/pdf/xpdf/Parser.cc \
${name}/lib/pdf/xpdf/Parser.h \
${name}/lib/pdf/xpdf/Stream-CCITT.h \
${name}/lib/pdf/xpdf/Stream.cc \
${name}/lib/pdf/xpdf/Stream.h \
${name}/lib/pdf/xpdf/UTF8.h \
${name}/lib/pdf/xpdf/UnicodeMap.cc \
${name}/lib/pdf/xpdf/UnicodeMap.h \
${name}/lib/pdf/xpdf/UnicodeMapTables.h \
${name}/lib/pdf/xpdf/XRef.cc \
${name}/lib/pdf/xpdf/XRef.h \
${name}/lib/pdf/aconf.h \
${name}/lib/pdf/xpdf/config.h \
${name}/lib/pdf/xpdf/gfile.cc \
${name}/lib/pdf/xpdf/gfile.h \
${name}/lib/pdf/xpdf/gmem.cc \
${name}/lib/pdf/xpdf/gmem.h \
${name}/lib/pdf/xpdf/gtypes.h \
${name}/lib/pdf/xpdf/FoFiBase.cc \
${name}/lib/pdf/xpdf/FoFiEncodings.cc \
${name}/lib/pdf/xpdf/FoFiTrueType.cc \
${name}/lib/pdf/xpdf/FoFiType1.cc \
${name}/lib/pdf/xpdf/FoFiType1C.cc \
${name}/lib/pdf/xpdf/JArithmeticDecoder.cc \
${name}/lib/pdf/xpdf/JBIG2Stream.cc \
${name}/lib/pdf/xpdf/JPXStream.cc \
${name}/lib/pdf/xpdf/Outline.cc \
${name}/lib/pdf/xpdf/PDFDocEncoding.cc \
${name}/lib/pdf/xpdf/FoFiBase.h \
${name}/lib/pdf/xpdf/FoFiEncodings.h \
${name}/lib/pdf/xpdf/FoFiTrueType.h \
${name}/lib/pdf/xpdf/FoFiType1.h \
${name}/lib/pdf/xpdf/FoFiType1C.h \
${name}/lib/pdf/xpdf/GMutex.h \
${name}/lib/pdf/xpdf/JArithmeticDecoder.h \
${name}/lib/pdf/xpdf/JBIG2Stream.h \
${name}/lib/pdf/xpdf/JPXStream.h \
${name}/lib/pdf/xpdf/Outline.h \
${name}/lib/pdf/xpdf/PDFDocEncoding.h \
${name}/lib/pdf/xpdf/Splash.cc \
${name}/lib/pdf/xpdf/Splash.h \
${name}/lib/pdf/xpdf/SplashBitmap.cc \
${name}/lib/pdf/xpdf/SplashBitmap.h \
${name}/lib/pdf/xpdf/SplashClip.cc \
${name}/lib/pdf/xpdf/SplashClip.h \
${name}/lib/pdf/xpdf/SplashErrorCodes.h \
${name}/lib/pdf/xpdf/SplashFTFont.cc \
${name}/lib/pdf/xpdf/SplashFTFont.h \
${name}/lib/pdf/xpdf/SplashFTFontEngine.cc \
${name}/lib/pdf/xpdf/SplashFTFontEngine.h \
${name}/lib/pdf/xpdf/SplashFTFontFile.cc \
${name}/lib/pdf/xpdf/SplashFTFontFile.h \
${name}/lib/pdf/xpdf/SplashFont.cc \
${name}/lib/pdf/xpdf/SplashFont.h \
${name}/lib/pdf/xpdf/SplashFontEngine.cc \
${name}/lib/pdf/xpdf/SplashFontEngine.h \
${name}/lib/pdf/xpdf/SplashFontFile.cc \
${name}/lib/pdf/xpdf/SplashFontFile.h \
${name}/lib/pdf/xpdf/SplashFontFileID.cc \
${name}/lib/pdf/xpdf/SplashFontFileID.h \
${name}/lib/pdf/xpdf/SplashGlyphBitmap.h \
${name}/lib/pdf/xpdf/SplashMath.h \
${name}/lib/pdf/xpdf/SplashOutputDev.cc \
${name}/lib/pdf/xpdf/SplashOutputDev.h \
${name}/lib/pdf/xpdf/TextOutputDev.cc \
${name}/lib/pdf/xpdf/TextOutputDev.h \
${name}/lib/pdf/xpdf/SplashPath.cc \
${name}/lib/pdf/xpdf/SplashPath.h \
${name}/lib/pdf/xpdf/SplashPattern.cc \
${name}/lib/pdf/xpdf/SplashPattern.h \
${name}/lib/pdf/xpdf/SplashScreen.cc \
${name}/lib/pdf/xpdf/SplashScreen.h \
${name}/lib/pdf/xpdf/SplashState.cc \
${name}/lib/pdf/xpdf/SplashState.h \
${name}/lib/pdf/xpdf/SplashT1Font.cc \
${name}/lib/pdf/xpdf/SplashT1Font.h \
${name}/lib/pdf/xpdf/SplashT1FontEngine.cc \
${name}/lib/pdf/xpdf/SplashT1FontEngine.h \
${name}/lib/pdf/xpdf/SplashT1FontFile.cc \
${name}/lib/pdf/xpdf/SplashT1FontFile.h \
${name}/lib/pdf/xpdf/SplashTypes.h \
${name}/lib/pdf/xpdf/SplashXPath.cc \
${name}/lib/pdf/xpdf/SplashXPath.h \
${name}/lib/pdf/xpdf/SplashXPathScanner.cc \
${name}/lib/pdf/xpdf/SplashXPathScanner.h"

PYTHON="${name}/lib/python/Makefile.in \
${name}/lib/python/SWF.c \
${name}/lib/python/gfx.c \
${name}/lib/python/image.c \
${name}/lib/python/image.h \
${name}/lib/python/primitives.c \
${name}/lib/python/primitives.h \
${name}/lib/python/pyutils.c \
${name}/lib/python/pyutils.h \
${name}/lib/python/action.c \
${name}/lib/python/action.h \
${name}/lib/python/tag.c \
${name}/lib/python/tag.h \
${name}/lib/python/tags.c \
${name}/lib/python/tags.h \
${name}/lib/python/taglist.c \
${name}/lib/python/taglist.h \
${name}/lib/python/tagmap.c \
${name}/lib/python/tagmap.h \
${name}/setup.py"

WXPDF2SWF="" #TODO
#WXPDF2SWF=" \
#${name}/wx/pdf2swf.py \
#${name}/wx/images.py"

CONFIGURE="${name}/configure.in \
${name}/configure \
${name}/config.h.in \
${name}/config.guess \
${name}/config.sub \
${name}/m4/byteorder.m4 \
${name}/m4/backticks.m4 \
${name}/m4/fontconfig.m4 \
${name}/m4/freetype.m4 \
${name}/m4/gcc.2.95.m4 \
${name}/m4/mingw.m4 \
${name}/m4/python.m4 \
${name}/m4/avi2swf.m4 \
${name}/m4/Makefile \
${name}/install-sh \
${name}/mkinstalldirs \
${name}/missing \
${name}/ltmain.sh"

DOC="${name}/doc/fileformat.sc \
${name}/ChangeLog"

tar -chf ${name}.tar \
${SOURCES} ${AVI2SWF} ${MAKEFILES} ${DOC} ${LIB} ${PYTHON} ${WXPDF2SWF} ${CONFIGURE} \
${name}/INSTALL \
${name}/COPYING \
${name}/AUTHORS \

gzip -9 ${name}.tar
rm -f ${name}

